Attribute VB_Name = "GestioneFile"
'=== Controllare se un file esiste  ===
Function FileExists(file As String) As Boolean
  Dim fso
  Set fso = CreateObject("Scripting.FileSystemObject")
  If Not fso.FileExists(file) Then
    FileExists = False
  Else
    FileExists = True
  End If
End Function
'=== Eliminare un file se esiste  ===
Sub DeleteFile(file As String)
    Dim fso
    Set fso = CreateObject("Scripting.FileSystemObject")
    If fso.FileExists(file) Then
        fso.DeleteFile file, True
    End If
End Sub
'=== Controllare se una cartella esiste ===
Function FolderExists(folder As String) As Boolean
  Dim fso
  Set fso = CreateObject("Scripting.FileSystemObject")
  If fso.FolderExists(folder) Then
    FolderExists = True
  Else
    FolderExists = False
  End If
End Function
'=== Creare una cartella se non esiste ===
Sub CreateFolder(folder As String)
  Dim fso
  If Not FolderExists(folder) Then
    MkDir folder
  End If
End Sub
